package com.beyond.trace.service.impl.storage;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.beyond.trace.domain.storage.Decrease;
import com.beyond.trace.domain.storage.Increase;
import com.beyond.trace.mapper.storage.DecreaseMapper;
import com.beyond.trace.mapper.storage.IncreaseMapper;
import com.beyond.trace.requestVo.IncreaseProductVo;
import com.beyond.trace.service.storage.IDecreaseService;
import com.beyond.trace.service.storage.IIncreaseService;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 出库记录信息Service业务层处理
 * 
 * @author yao
 * @date 2022-03-02
 */
@Service
public class DecreaseServiceImpl extends ServiceImpl<DecreaseMapper, Decrease> implements IDecreaseService
{

    @Autowired
    private DecreaseMapper decreaseMapper;

    @Override
    public List<IncreaseProductVo> getIncreaseProductList() {
        if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
            return decreaseMapper.getIncreaseProductList(String.valueOf(SecurityUtils.getUserDepartId()));
        }
        return decreaseMapper.getIncreaseProductList("");
    }
}
